<div id="search">
	
<span class="input-container">
	<input id="autocomplete-tag" class="input" type="text" name="tag" value="Search tag"
		onfocus="clearField(this)" onblur="restoreField(this, 'Search tag')" />
</span>
or
<span class="input-container">
	<input id="autocomplete-user" class="input" type="text" name="user" value="Search user" 
		onfocus="clearField(this)" onblur="restoreField(this, 'Search user')" /></span>
<span id="indicator" style="display:none"><img src="<?echo $base_url?>style/img/indicator.gif" alt="Loading" /></span>
<div id="autocomplete-choices-user" class="autocomplete"></div>
<div id="autocomplete-choices-tag" class="autocomplete"></div>

<script type="text/javascript" charset="utf-8">
//<![CDATA[
	new Ajax.Autocompleter("autocomplete-user", "autocomplete-choices-user", "<?echo $hd->getBaseURL();?>auto", {
		paramName:"user", 
		minChars:1,
		//indicator: 'indicator',
		updateElement:function(elem, li) {
			/*var str = "";
			for(prop in elem) {
				str += prop + " value:"+ elem[prop]+"<br />\n";
			}
			$('debug').innerHTML = str;*/
			if(elem.id.indexOf(" ")==-1) {
				location.href = "<?echo $base_url;?>user/"+elem.id;
			}
		}
	});
	new Ajax.Autocompleter("autocomplete-tag", "autocomplete-choices-tag", "<?echo $hd->getBaseURL();?>auto", {
		paramName:"tag", 
		minChars:1,
		//indicator: 'indicator',
		updateElement:function(elem, li) {
			if(elem.id.indexOf(" ")==-1) {
				location.href = "<?echo $base_url;?>user/"+elem.id;
			}
		}
	});
//]]>
</script>

</div>